const express = require("express");
const formatResponse = require("../utils/responseFormat");
const about = require("../service/aboutService");

const aboutRouter = express.Router();

//设置关于页面
aboutRouter.post("/", async (req, res, next) => {
  const url = req.body;
  const data = await about.setAbout(url);
  res.send(formatResponse(0, "", data));
});

//获取关于页面
aboutRouter.get("/", async (req, res, next) => {
  const data = await about.getAbout();
  res.send(formatResponse(0, "", data));
});

module.exports = aboutRouter;
